using Pinwheel.Service;
using Pinwheel.Service.Protocol;

namespace Pinwheel.Kernel.Test
{
    public class Bootstrap : IBootstrap
    {
        public int Start(ServiceManager serviceManager)
        {
            // serviceManager.StartNewService<GatewayBase>("Gateway");
            var config = serviceManager.Config;
            var pid = serviceManager.StartNewService<WatchdogBase>("Watchdog");
            serviceManager.Send(PID.System, pid, "Start", MessageType.Service, new Start()
            {
                Value1 = config.ServerPort,
                Value2 = config.MaxConnection,
            });
            return 0;
        }
    }
    
    public class BootstrapEmpty : IBootstrap
    {
        public int Start(ServiceManager serviceManager)
        {
            return 0;
        }
    }
}